package com.vf.admin.client.service.impl;

import com.vf.admin.client.dao.AppRoomCollectDao;
import com.vf.admin.client.service.AppRoomCollectService;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppRoom;
import com.vf.admin.miaodong.entity.AppRoomCollect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppRoomCollectServiceImpl implements AppRoomCollectService {
    @Autowired
    private AppRoomCollectDao appRoomCollectDao;

    @Override
    public AppRoomCollect OfficialPersonalList(Integer userid,Integer roomid) {
        return appRoomCollectDao.OfficialPersonalList(userid,roomid);
    }

    @Override
    public List<AppRoomCollect> findList(Integer userid,SplitPageBean pageBean) {
        return appRoomCollectDao.findList(userid,pageBean);
    }

    @Override
    public AppRoomCollect get(Integer id) {
        return appRoomCollectDao.get(id);
    }

    @Override
    public void save(AppRoomCollect haoYou) {
        appRoomCollectDao.save(haoYou);
    }

    @Override
    public void roomCollectSave(Integer userid,AppRoom room) {
        AppRoomCollect roomCollect = new AppRoomCollect();
        roomCollect.setUserid(userid);
        roomCollect.setRoomid(room.getId());
        roomCollect.setRoomcode(room.getRoomcode());
        roomCollect.setTengxuncode(room.getTengxuncode());
        roomCollect.setRoomname(room.getRoomname());
        roomCollect.setRoomtypeid(room.getRoomtypeid());
        roomCollect.setXingzhi(room.getXingzhi());
        roomCollect.setRoomimg(room.getRoomimg());
        roomCollect.setRoomtypename(room.getRoomtypename());
        appRoomCollectDao.save(roomCollect);
    }

    @Override
    public void del(Integer id) {
        appRoomCollectDao.del(id);
    }

}
